package top.saodisheng.aspect;

import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

/**
 * description:
 * 使用Spring的API接口定义切面通知
 * 这里通过配置文件注入
 *
 * @author 扫地生_saodisheng
 * @date 2021/9/20
 */
public class BeforeLog implements MethodBeforeAdvice {
	@Override
	public void before(Method method, Object[] args, Object target) throws Throwable {
		System.out.println("log: " + target.getClass().getName() + "的 "
				+ method.getName() + " 方法被执行了");
	}
}
